Skip to main content

정수 제곱근 판별

Solution

function solution(n) {
const tmp = Math.sqrt(n);
return Number.isInteger(tmp) ? Math.pow(tmp + 1, 2) : -1;
}

Review

.

References